package jwj8508.j2ee.basic;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.Date;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("/02HelloServlet")
public class _02HelloServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
   
	protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
		res.setContentType("text/html; charset=UTF-8");
		PrintWriter out = res.getWriter();
		out.print("<html>");
		out.print("<head><title>Hello, Servelet!!</title></head>");
		out.print("<body>");
		out.print("<h1 style='color: red;'>Hello, Servelet!!</h1>");
		out.print("<h3 style='color: blue;'>현재 시간은  " + new Date().toLocaleString() + "입니다.</h3>");		
		out.print("</body>");
		out.print("</html>");
	}

}
